<!DOCTYPE html>
<html>
  <head lang="en">
    <meta charset="UTF-8" />
    <title>Background images with "image-set" - Lazyload demos</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <style>
      ul,
      li {
        list-style-type: none;
        margin: 0;
        padding: 0;
      }

      a {
        display: block;
        width: 220px;
        height: 280px;
        background-size: 220px 280px;
      }

      a.multiple {
        width: 440px;
        background-repeat: no-repeat;
        background-position: left, right;
      }
    </style>
  </head>

  <body>
    <h1>Background images with <q>image-set</q> demo</h1>
    <div id="results1" class="results">
      <ul>
        <li>
          <a
            href="#"
            style="
              background-image: image-set(
                url('./images/220x280-01.webp') 1x,
                url('./images/440x560-01.webp') 2x
              );
            "
          ></a>
        </li>
        <li>
          <a
            class="multiple"
            href="#"
            style="
              background-image: image-set(
                  url('./images/220x280-L-02.webp') 1x,
                  url('./images/440x560-L-02.webp') 2x
                ),
                image-set(
                  url('./images/220x280-R-02.webp') 1x,
                  url('./images/440x560-R-02.webp') 2x
                );
            "
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-03.webp") 1x, url("./images/440x560-03.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy multiple"
            href="#"
            data-bg-set='url("./images/220x280-L-04.webp") 1x, url("./images/440x560-L-04.webp") 2x | url("./images/220x280-R-04.webp") 1x, url("./images/440x560-R-04.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-05.webp") 1x, url("./images/440x560-05.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-06.webp") 1x, url("./images/440x560-06.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-07.webp") 1x, url("./images/440x560-07.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-08.webp") 1x, url("./images/440x560-08.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-09.webp") 1x, url("./images/440x560-09.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-10.webp") 1x, url("./images/440x560-10.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-11.webp") 1x, url("./images/440x560-11.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-12.webp") 1x, url("./images/440x560-12.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-13.webp") 1x, url("./images/440x560-13.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-14.webp") 1x, url("./images/440x560-14.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-15.webp") 1x, url("./images/440x560-15.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-16.webp") 1x, url("./images/440x560-16.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-17.webp") 1x, url("./images/440x560-17.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-18.webp") 1x, url("./images/440x560-18.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-19.webp") 1x, url("./images/440x560-19.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-20.webp") 1x, url("./images/440x560-20.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-21.webp") 1x, url("./images/440x560-21.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-22.webp") 1x, url("./images/440x560-22.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-23.webp") 1x, url("./images/440x560-23.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-24.webp") 1x, url("./images/440x560-24.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-25.webp") 1x, url("./images/440x560-25.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-26.webp") 1x, url("./images/440x560-26.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-27.webp") 1x, url("./images/440x560-27.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-28.webp") 1x, url("./images/440x560-28.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-29.webp") 1x, url("./images/440x560-29.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-30.webp") 1x, url("./images/440x560-30.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-31.webp") 1x, url("./images/440x560-31.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-32.webp") 1x, url("./images/440x560-32.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-33.webp") 1x, url("./images/440x560-33.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-34.webp") 1x, url("./images/440x560-34.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-35.webp") 1x, url("./images/440x560-35.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-36.webp") 1x, url("./images/440x560-36.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-37.webp") 1x, url("./images/440x560-37.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-38.webp") 1x, url("./images/440x560-38.webp") 2x'
          ></a>
        </li>
        <li>
          <a
            class="lazy"
            href="#"
            data-bg-set='url("./images/220x280-39.webp") 1x, url("./images/440x560-39.webp") 2x'
          ></a>
        </li>
      </ul>
    </div>
    <script src="../dist/lazyload.min.js"></script>
    <script>
      function logElementEvent(eventName, element) {
        console.log(Date.now(), eventName, element.getAttribute("data-bg88da112-bg-hidpi=bg"));
      }

      var callback_enter = function (element) {
        logElementEvent("🔑 ENTERED", element);
      };
      var callback_exit = function (element) {
        logElementEvent("🚪 EXITED", element);
      };
      var callback_loading = function (element) {
        logElementEvent("⌚ LOADING", element);
      };
      var callback_loaded = function (element) {
        logElementEvent("👍 LOADED", element);
      };
      var callback_error = function (element) {
        logElementEvent("💀 ERROR", element);
        element.style.backgroundImage = 'url("./images/440x560-Error.webp")';
      };
      var callback_finish = function () {
        logElementEvent("✔️ FINISHED", document.documentElement);
      };
      var callback_cancel = function (element) {
        logElementEvent("🔥 CANCEL", element);
      };

      LL = new LazyLoad({
        // Assign the callbacks defined above
        callback_enter: callback_enter,
        callback_exit: callback_exit,
        callback_cancel: callback_cancel,
        callback_loading: callback_loading,
        callback_loaded: callback_loaded,
        callback_error: callback_error,
        callback_finish: callback_finish
      });
    </script>
  </body>
</html>
